1. Field of the Invention
This invention relates to video data compression.
2. Description of the Prior Art
It has long been recognised that some video data compression systems, such as systems broadly defined by the MPEG-2 standard, use compression techniques in which the number of compressed data bits generated for a picture, or a part of a picture, depends on the nature of the image represented by that picture. Also, the main compression parameter which can be altered from block to block or picture to picture to change the bit rate, namely the degree of quantisation, has a somewhat non-linear and difficult to predict effect on the resulting bit rate.
These characteristics are of particular concern in systems such as video tape recorders, where there is generally a fixed allocation of bits for each picture or group of pictures (GOP) and little or no scope for exceeding that fixed allocation. As a result, techniques for bit rate control in video data compression are very important.
The so-called xe2x80x9cTest Model 5xe2x80x9d of the MPEG 2 system proposes a rate control algorithm that allocates bits between pictures in accordance with a xe2x80x9cglobal complexity estimationxe2x80x9d dependent upon the actual number of bits generated in respect of a preceding picture and the quantisation parameters used to achieve this. The actual bit rate achieved during compression of a picture is then monitored and the degree of quantisation varied during compression to try to achieve the desired total bit rate for that picture. This system can, however, be slow to react to changes in image type during the compression of a picture and cannot predict the presence of difficult-to-encode image portions (requiring a higher bit rate) towards the end of a particular picture.
GB-A-2 306 831 proposes various techniques for pre-coding or rehearsing the data compression of some or all of a GOP in order to arrive at a quantisation scheme for the GOP which will avoid exceeding the allocated bit rate. However, in modern systems fabricated using ASICs (application specific integrated circuits), the processing overhead of providing two or more encoders, or of running a single encoder at a multiple speed to carry out the rehearsal encoding followed by the final encoding, can be too great or too expensive for current ASIC design techniques.
This invention provides a video data compression apparatus for compressing images of an input video signal on a block-by-block basis, the apparatus comprising:
a block analyser for analysing each block of an image to be compressed to detect a degree of difference between pixels within that block;
a data quantity allocator for allocating target output data quantities for the compression of each block, the target data quantities being dependent on the detected degrees of pixel difference of the blocks; and
a data compression encoder for compressing each block in accordance with the target output data quantity associated with that block.
The invention addresses the above problems by providing a pre-allocation of data output quantity (bits) to blocks within an image on the basis of the detected degree of pixel difference within each block. Compression can then take place towards the targets set in this way, for example by using an adaptive encoder which varies its compression parameters during compression to achieve its target.
In other embodiments, an encoder using a rehearsal technique may be employed, and here it is noted that because of the overall pre-allocation between blocks it is not then necessary to rehearse the whole image. This can save dramatically on memory and delay in the apparatus.
Of course, the blocks need not be square and indeed need not be of the same sizes, although if different sized blocks are used then the block size can be used as an additional factor in the data quantity allocation.
Although a preferred embodiment is in the form of an II-VTR using intra (I) pictures only, the invention is equally applicable to systems using GOPs also including P pictures, B pictures or both.
Further respective aspects and features of the invention are defined in the appended claims.